package main

import (
	"fmt"
	"reflect"
)

func main() {
	fVar := 3.14
	v := reflect.ValueOf(fVar)
	fmt.Printf("is float canSet:%v,canAddr: %v\n", v.CanSet(), v.CanAddr())
	v.SetFloat(2222.1) //这里会panic
	vp := reflect.ValueOf(&fVar)
	fmt.Printf("is float canSet:%v,canAddr: %v\n", vp.Elem().CanSet(), vp.Elem().CanAddr())
	vp.Elem().SetFloat(4.13)
	fmt.Println(fVar)
}
